<template>
    <casedetail
      :readonly="true"
      ref="casedetail"
      @tabclick="tabclick"
    >
    <form-btns ref="btns" slot="btns" @close="cancle" @transfer="submit"/>
    <div class="cust-panel" slot="cust-panel"  v-show="this.tabindex==5">
         <userinfo ref="userinfo"/>
    </div>
    </casedetail>
</template>
<script>
import { mapActions, mapGetters, mapState } from "vuex";
import casedetail from "@/views/case/detail/casedetail";
import userinfo from "@/views/system/user/index";
import FormBtns from "@/views/comps/zhzf/form-btns";
export default {
  data() {
    return {
      detail: {
        newTabItem:'',
      },
        tabindex:'',
        casedetailshow:true
    };
  },
  components: {
    casedetail, userinfo,FormBtns
  },
  mounted(){
      let detail = this.$route.params.row;
      this.initPage(detail);
  },
  methods: {
    ...mapActions("d2admin/page", ["close"]),
    cancle(){
      this.close({ tagName: "/case/reg/detail" });
    },
    submit(){
        this.$refs.casedetail.submitData();
    },
    async initPage(detail){
        this.$refs.casedetail.initPage(detail);
        this.$refs.btns.setBtns([
            {url: 'close', name: '取消', icon: 'fa fa-close', type: 'danger'},
            {url: 'transfer', name: '暂存', icon: 'fa fa-close', type: 'primary'},
        ])
    },
     tabclick(tab){
        this.tabindex = tab.index;
      }
  }
};
</script>
<style lang="scss">
.case-detail {
  background: #fff;
  padding-bottom: 20px;
  border: 1px solid #ccc;
  .el-form {
    .el-form-item__label {
      width: 120px !important;
    }
    .el-form-item__content {
      margin-left: 120px !important;
    }
    .el-date-editor.el-input {
      width: 100% !important;
    }
  }
}
</style>
